package org.eclipse.gittab.fretboard.draw2d.figures;

import org.eclipse.draw2d.Ellipse;
import org.eclipse.draw2d.Figure;
import org.eclipse.draw2d.geometry.Point;
import org.eclipse.draw2d.geometry.Rectangle;

@Deprecated
public class ClassicFretInlayFigure extends Figure {

	public static final int SIZE = 10;

	public ClassicFretInlayFigure(Rectangle fretBounds, boolean two) {

		setOpaque(false);
		setVisible(true);

		int x = fretBounds.x;
		int y = fretBounds.y;
		int w = fretBounds.width;
		int h = fretBounds.height;

		Ellipse e;
		if (two) {

			e = new InlayEllipse();
			e
					.setLocation(new Point(x + w / 2 - SIZE / 2, y + h / 4
							- SIZE / 2));
			add(e);

			e = new InlayEllipse();
			e
					.setLocation(new Point(x + w / 2 - SIZE / 2, y + h / 4
							- SIZE / 2));
			add(e);
		} else {

			e = new InlayEllipse();
			e
					.setLocation(new Point(x + w / 2 - SIZE / 2, y + h / 2
							- SIZE / 2));
			add(e);
		}
	}

	class InlayEllipse extends Ellipse {

		public InlayEllipse() {

			setFill(true);
			setLineWidth(1);
			setOpaque(true);
			setSize(SIZE, SIZE);
			setVisible(true);
		}
	}
}
